package cn.jobstart.spider.pipeline;

import cn.jobstart.common.StringUtil;
import cn.jobstart.service.ICompanyJobService;
import cn.jobstart.service.ICompanyService;
import cn.jobstart.spider.model.NbrcCompany;
import cn.jobstart.spider.model.NbrcJob;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

import javax.annotation.Resource;

/**
 * @author sunke
 * @version 1.0
 * @Description 宁波人才网职
 * @date 2023-09-19 15:41
 */
public class NbrcJobPipline extends AbstractPipline {


    @Resource
    private ICompanyJobService companyJobService;

    @Resource
    private ICompanyService companyService;


    /**
     * Process extracted results.
     *
     * @param resultItems resultItems
     * @param task        task
     */
    @Override
    public void process(ResultItems resultItems, Task task) {




        NbrcJob nbrcJob = resultItems.get("jobDetail");
        if (StringUtil.isNotObjEmpty(nbrcJob)) {

            System.out.println(nbrcJob);
        }
        NbrcCompany nbrcCompany =resultItems.get("companyDetail");

        if (StringUtil.isNotObjEmpty(nbrcCompany)) {
            System.out.println(nbrcCompany);
        }


        System.out.println(resultItems);


    }
}
